import os
import json


class Config:
    def __init__(self):
        self.icon = Config.__read_config("icon.json")
        self.app = Config.__read_config("app.json")
        self.nvidia = Config.__read_config("nvidia.json")
        self.nvidia = Config.__read_config("sys.json")

    @staticmethod
    def __read_config(config_name: str):
        curr_dir = os.path.dirname(os.path.abspath(__file__))
        curr_dir = os.path.dirname(curr_dir)
        config_path = os.path.join(curr_dir, "config", config_name)
        with open(config_path, "r") as file:
            json_data = json.load(file)
        return json_data


config = Config()
